//
//  ChongzhijiluCell.m
//  SSC
//
//  Created by 红沙尘 on 17/6/11.
//  Copyright © 2017年 红沙尘. All rights reserved.
//

#import "ChongzhijiluCell.h"

@interface ChongzhijiluCell ()

@property (nonatomic, copy) NSDictionary *tixianDict;

@end

@implementation ChongzhijiluCell
{
    __weak IBOutlet UILabel *labelA;
    __weak IBOutlet UILabel *labelB;
    __weak IBOutlet UILabel *labelC;
    __weak IBOutlet UILabel *labelD;
    
    __weak IBOutlet UIView *bg;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    
    bg.layer.borderWidth = LineHeight;
    bg.layer.borderColor = COLOR_CCCCCC.CGColor;
}

- (void)loadChongzhiDict:(NSDictionary *)dict {
    
    labelA.text = [NSString stringWithFormat:@"充值时间: %@",dict[@"time"]];
    labelB.text = [NSString stringWithFormat:@"充值金额: %@",dict[@"amount"]];
    labelC.text = [NSString stringWithFormat:@"充值方式: %@",[self type:[dict[@"type"] intValue]]];
    labelD.text = [NSString stringWithFormat:@"充值状态: %@",[self status:[dict[@"status"] intValue]]];
}

- (void)loadTixianDict:(NSDictionary *)dict {
    
    self.tixianDict = dict;
    
    labelA.text = [NSString stringWithFormat:@"提现时间: %@",dict[@"time"]];
    labelB.text = [NSString stringWithFormat:@"提现金额: %@",dict[@"amount"]];
    labelC.text = [NSString stringWithFormat:@"提现方式: %@",[self type:[dict[@"type"] intValue]]];
    labelD.text = [NSString stringWithFormat:@"提现状态: %@",[self tixianStatus:[dict[@"status"] intValue]]];
}

- (NSString *)type:(int)type {
    switch (type) {
            case 0: return @"微信";
            case 1: return @"支付宝";
            case 2: return @"支付宝wap";
        default: break;
    }
    
    return @"";
}

- (NSString *)tixianStatus:(NSInteger)status {
    switch (status) {
        case 0:return @"申请中";
        case 1:return @"成功";
        default: break;
    }
    
    return [NSString stringWithFormat:@"拒绝:%@",self.tixianDict[@"refuse"]];
}

- (NSString *)status:(int)status {
    
    switch (status) {
        case 0:return @"失败";
        case 1:return @"成功";
        default: break;
    }
    
    return @"处理中";
}

@end
